<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/11/8
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>


<%
//    Cookie  jsession


    //1 创建
    Cookie cookie = new Cookie("route", "routerm");
    //用于显示 向哪个应用提交 cookie
    cookie.setDomain("127.0.0.1");
    cookie.setPath("/web03");
    //过期时间
    cookie.setMaxAge(10);

    // true  js放不了， false 允许 js访问
    cookie.setHttpOnly(true);

//    cookie.setSecure();  未true 只能在 https下发送




    //2 发送  req     resp
    response.addCookie(cookie);




%>

<h3>设置Cookie</h3>

</body>
</html>
